﻿<?php
$id=$_REQUEST['id'];
$sql="SELECT * FROM tailieu WHERE id='$id'";
$sp=$dp->QueryOne($sql);
?>
<script type="text/javascript">
function checkform()
  {
	 
	var content= document.getElementById('content');
	var images= document.getElementById('images');
	var name= document.getElementById('name');
	var link= document.getElementById('link');

	
	

	
	if(name.value=='') 
	 {
	 alert('Tieu de  cho  Phần  mềm');
		 name.focus();
		 return false;
	 }
	 	
	  if(images.value=='') 
	 {
		 alert('Chưa có hình cho Phần mềm');
		 images.focus();
		 return false;
	 }
	 if(link.value=='') 
	 {
	 alert('chưa có file ');
		 link.focus();
		 return false;
	 }
	  if(content.value=='') 
	 {
	 alert('chưa có nội dung ');
	 alert('chưa có nội dung ');
		 content.focus();
		 return false;
	 }
	
	 
	
}

</script>
</head>
<center>

<div id="table">
<form action="index.php?option=tailieu&amp;cat=xuly" method="post" enctype="multipart/form-data" name="form1">

 <table width="100%" border="1" cellspacing="5" cellpadding="5" border="10px" bordercolor="#FF">
 
   <tr bgcolor="#666666">
      <td colspan="2" align="center" valign="middle" bgcolor="#FFFFFF"><strong><h1>Sửa Thông tin Tài Liệu</h1></strong></td>
    </tr>
    <tr >
      <td width="70" align="center" valign="middle">Tiêu đề</td>
      <td align="left" valign="middle"><label for="name"></label>
      <input name="name"  value="<?php echo $sp['name']; ?>" type="text" id="name" size="50"></td>
    </tr>
    <tr >
      <td width="70" align="center" valign="middle">Hình ảnh</td>
      <td align="left" valign="middle"><label for="images"></label>
      <input type="file" name="images" value="<?php echo $sp['images']; ?>" id="images"></td>
	
    </tr>
	<tr >
      <td width="70" align="center" valign="middle">Đính Kèm file</td>
      <td align="left" valign="middle"><label for="link"></label>
      <input type="file" name="link"  value="<?php echo $sp['link']; ?>" id="link"></td>
	  
    </tr>
    <tr >
      <td width="70" align="center" valign="middle">Nội dung</td>
      <td align="left" valign="middle"><label for="content"></label>
      <textarea name="content" id="content" class="ckeditor" cols="50" rows="5"  <?php echo $sp['content']; ?>></textarea></td>
    </tr>
    
    <tr >
      <td width="70" align="center" valign="middle">Trạng thái</td>
      <td align="left" valign="middle"><label for="states"></label>
        <select name="states" id="states">
          <option value="0">Ẩn</option>
          <option value="1">Hiện</option>
      </select></td>
    </tr>
  <tr>
    <td><center>
      <label><input type="submit" name="DANG" value="Gửi" onclick="return checkform()" /></label>
      <label> <input type="reset" name="Submit2" value="Huỷ thông tin đã nhập" /></label>
     </center></td>
  </tr>
</table></div></center>
</form>
